package org.bonorsoft.modules.wechat.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.bonorsoft.modules.wechat.mapper.EchoPhotoMapper;
import org.bonorsoft.modules.wechat.service.IEchoPhotoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 呼应 请求 照片处理
 */
@Service
@Slf4j
public class EchoPhotoServiceImpl implements IEchoPhotoService {
    @Resource
    private EchoPhotoMapper echoPhotoMapper;

    /**
     * 添加图片
     *
     * @param qqid
     * @param photo
     */
    @Override
    public int addPhoto(String qqid, String photo) {
        return echoPhotoMapper.addPhoto(qqid,photo);
    }

    /**
     * 获取图片
     *
     * @param qqid
     * @return
     */
    @Override
    public List<String> getPhoto(String qqid) {
        return echoPhotoMapper.getPhoto(qqid);
    }

    /**
     * 删除图片
     *
     * @param qqid
     */
    @Override
    public void deletePhoto(String qqid) {
        echoPhotoMapper.deletePhoto(qqid);
    }

    /**
     * 批量删除
     *
     * @param ids
     */
    @Override
    public void deletePhotoByIds(List<String> ids) {
        for (String id : ids) {
            echoPhotoMapper.deletePhoto(id);
        }
    }
}
